<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="utf-8">

    <title>选课信息管理页面</title>
    <!--引入相关的js文件-->
    <link href="../backPage/ui/bootstrap-3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../backPage/ui/bootstrap-table-1.11.0/bootstrap-table.min.css" rel="stylesheet"/>
    <link href="../backPage/ui/waves-0.7.5/waves.css" rel="stylesheet"/>
    <link href="../backPage/ui/jquery-confirm/jquery-confirm.min.css" rel="stylesheet"/>
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>

    <script src="../backPage/ui/js/jquery-3.3.1.min.js"></script>
    <script src="../backPage/ui/waves-0.7.5/waves.js"></script>
    <script src="../backPage/ui/jquery-confirm/jquery-confirm.min.js"></script>
    <script src="../backPage/ui/bootstrap-3.3.0/js/bootstrap.min.js"></script>
    <script src="../backPage/ui/bootstrap-table-1.11.0/bootstrap-table.min.js"></script>
</head>

<body>
<div id="main">
    <div id="toolbar">

        <button class="btn btn-default" href="javascript:;" onclick="updateAction()">打分</button>

        <br/>
    </div>
    <table id="table"></table>
</div>

<script>
    // 初始化input特效
    function initMaterialInput() {
        $('form input[type="text"]').each(function () {
            if ($(this).val() != '') {
                $(this).parent().find('label').addClass('active');
            }
        });
    }

    var $table = $('#table');


    $(function() {
        init();
        $("#cid").change(function(){
            var courseIndex = ($("#cid option:selected").val());
            $.ajax({
                url:"/studentManageSystem/getTeacherInfoByCourseId/"+courseIndex,
                type:"post",
                success:function(data){
                    $("#teachername").val(data);
                }
            });

            $.ajax({
                url:"/studentManageSystem/initQxAndLabel/"+courseIndex,
                type:"post",
                success:function(res){
                    var indexs = res[0].split(" ");
                    var score = res[1].split(" ");
                    var label = ['工程知识及分析','工程知识及分析','终身学习','使用现代工具','项目管理','设计/开发解决方案','研究'];
                    $(".lq").hide();
                    $(".qx").hide();
                    for(var i = 0;i<label.length;i++){
                        $(".qx").eq(i).val(0);
                    }
                    for(var i = 0;i<indexs.length;i++){
                        $(".lq").eq(parseInt(indexs[i])).text(label[i]+"(0-"+score[i]+")");
                        $(".lq").eq(parseInt(indexs[i])).show();
                        $(".qx").eq(parseInt(indexs[i])).show();
                    }
                }
            });

            $.ajax({
                url:"/studentManageSystem/getCourseStateByCid/"+courseIndex,
                type:"post",
                success:function(data){
                    $("#state").val(data);
                }
            });
        });

        $(".qx").each(function(i){
            $(this).change(function(){
                var cid = $("#cid").val();
                var score = $(this).val();
                // $.ajax({
                //     url:"/studentManageSystem/checkScoreLimitedIsRight",
                //     data:{cid:cid,index:i,score:score},
                //     type:"post",
                //     success:function(data){
                //         // if(data != ""){
                //         //     alert(data);
                //         //     $(this).val('');
                //         // }
                //     }
                // })
            })
        });

        $(".uqx").each(function(i){
            $(this).change(function(){
                var cid = $("#updateCid").val();
                var score = $(this).val();
                // $.ajax({
                //     url:"/studentManageSystem/checkScoreLimitedIsRight",
                //     data:{cid:cid,index:i,score:score},
                //     type:"post",
                //     success:function(data){
                //         // if(data != ""){
                //         //     $(this).val('0');
                //         //     alert(data);
                //         // }
                //     }
                // })
            })
        });

        $("#updateCid").change(function(){
            var courseIndex = ($("#updateCid option:selected").val());
            $.ajax({
                url:"/studentManageSystem/getTeacherInfoByCourseId/"+courseIndex,
                type:"post",
                success:function(data){
                    $("#updateTeacherName").val(data);
                }
            });

            $.ajax({
                url:"/studentManageSystem/getCourseStateByCid/"+courseIndex,
                type:"post",
                success:function(data){
                    $("#updateState").val(data);
                }
            });
        });

        //新增选课信息
        $("#submitbutton").click(function() {
            var studentid = $("#sid").val();
            var studentname = $("#sname").val();
            var state = $("#state").val();
            var cid = $("#cid option:selected").val();
            var normalscore = $("#normalscore").val();
            var testscore = $("#testscore").val();
            var finalscore = $("#finalscore").val();
            var q1 = $("#q1").val();
            var q2 = $("#q2").val();
            var q3 = $("#q3").val();
            var q4 = $("#q4").val();
            var q5 = $("#q5").val();
            var q6 = $("#q6").val();
            var q7 = $("#q7").val();

            if(state == "结课"){
                if(normalscore.length == 0||testscore.length == 0||finalscore.length == 0||q1.length == 0||q2.length == 0||q3.length == 0||q4.length == 0||q5.length == 0||q6.length == 0||q7.length == 0){
                    alert("请填写成绩信息");
                    return ;
                }else{
                    normalscore = parseInt(normalscore);
                    testscore = parseInt(testscore);
                    finalscore = parseInt(finalscore);
                    q1 = parseFloat(q1);
                    q2 = parseFloat(q2);
                    q3 = parseFloat(q3);
                    q4 = parseFloat(q4);
                    q5 = parseFloat(q5);
                    q6 = parseFloat(q6);
                    q7 = parseFloat(q7);
                    if(q1<0||q2<0||q3<0||q4<0||q5<0||q6<0||q7<0||normalscore < 0 ||normalscore > 100||testscore<0||testscore>100||finalscore<0||finalscore>100){
                        alert("成绩填写不合法,请重试");
                        return;
                    }
                }
            }else{
                normalscore = 0;
                testscore = 0;
                finalscore = 0;
                q1 = 0;
                q2 = 0;
                q3 = 0;
                q4 = 0;
                q5 = 0;
                q6 = 0;
                q7 = 0;
            }

            cid = parseInt(cid);

            if(studentid.length!=0){
                $.ajax({
                    url:"/studentManageSystem/addChooseCourseInfoBySid/"+studentid,
                    type:"post",
                    data:{cid:cid,sid:studentid,state:state,normalscore:normalscore,testscore:testscore,finalscore:finalscore,q1:q1,q2:q2,q3:q3,q4:q4,q5:q5,q6:q6,q7:q7},
                    success:function(data){
                        if(data == "OK"){
                            alert("添加成功");
                            $("#createModal").modal('hide');
                            $table.bootstrapTable('refresh');
                        }else if(data != ""){
                            alert(data);
                        }else if(data == ""){
                            alert("添加失败,信息重复");
                        }
                    }
                })
            }else{
                if(studentname.length == 0){
                    alert("请填写学号或者姓名!");
                    return;
                }else{
                    $.ajax({
                        url:"/studentManageSystem/addChooseCourseInfoBySname/"+studentname,
                        type:"post",
                        data:{cid:cid,sid:studentid,state:state,normalscore:normalscore,testscore:testscore,finalscore:finalscore,q1:q1,q2:q2,q3:q3,q4:q4,q5:q5,q6:q6,q7:q7},
                        success:function(data){
                            if(data == "OK"){
                                alert("添加成功");
                                $("#createModal").modal('hide');
                                $table.bootstrapTable('refresh');
                            }else if(data!=""){
                                alert(data);
                            }else if(data ==""){
                                alert("添加失败,信息重复");
                            }
                        }
                    })
                }
            }


        });


        //上传信息
        $("#uploadbutton").click(function(){
            var fname = $("#file").val();
            var pathArray = fname.split("\\");
            if(pathArray[pathArray.length - 1].indexOf(".") == -1){
                alert("请上传文件");
                return;
            }else{
                filetype = pathArray[pathArray.length - 1].split(".")[1];

                if(filetype == "xls"||filetype=="xlsx"){
                    var type = "file";          //后台接收时需要的参数名称，自定义即可
                    var id = "file";            //即input的id，用来寻找值
                    var formData = new FormData();
                    formData.append(type, $("#"+id)[0].files[0]);    //生成一对表单属性
                    $.ajax({
                        type: "post",           //因为是传输文件，所以必须是post
                        url:"/studentManageSystem/uploadChooseCourseInfos",
                        data: formData,
                        processData: false,
                        contentType: false,
                        success: function (data) {
                            if(data != ""){
                                $table.bootstrapTable('refresh');
                                alert(data);
                            }else{
                                alert("导入失败");
                            }
                        }
                    });

                }else{
                    alert("请上传xls、xlsx格式文件!");
                    return;
                }
            }
        });

        //更新选课信息
        $("#updateSubmitButton").click(function(){
            var chooseid = $("#updateChooseId").val();
            var cid = $("#updateCid option:selected").val();
            var sid = $("#updateSid").val();
            var state = $("#updateState").val();
            var normalscore = $("#updateNormalscore").val();
            var testscore = $("#updateTestScore").val();
            var finalscore = $("#updateFinalScore").val();
            var q1 = $("#uq1").val();
            var q2 = $("#uq2").val();
            var q3 = $("#uq3").val();
            var q4 = $("#uq4").val();
            var q5 = $("#uq5").val();
            var q6 = $("#uq6").val();
            var q7 = $("#uq7").val();
            if(sid.length == 0){
                alert("请填写正确的学号");
                return;
            }

            if(state == "结课"){
                if(normalscore.length == 0||testscore.length == 0||finalscore.length == 0||q1.length == 0||q2.length == 0||q3.length == 0||q4.length == 0||q5.length == 0||q6.length == 0||q7.length == 0){
                    alert("请填写成绩信息");
                    return ;
                }else{
                    normalscore = parseInt(normalscore);
                    testscore = parseInt(testscore);
                    finalscore = parseInt(finalscore);
                    q1 = parseFloat(q1);
                    q2 = parseFloat(q2);
                    q3 = parseFloat(q3);
                    q4 = parseFloat(q4);
                    q5 = parseFloat(q5);
                    q6 = parseFloat(q6);
                    q7 = parseFloat(q7);
                    // if(q1<0||q2<0||q3<0||q4<0||q5<0||q6<0||q7<0||normalscore < 0 ||normalscore > 100||testscore<0||testscore>100||finalscore<0||finalscore>100){
                    //     alert("成绩填写不合法,请重试");
                    //     return;
                    // }
                }
            }else{
                normalscore = 0;
                testscore = 0;
                finalscore = 0;
                q1 = 0;
                q2 = 0;
                q3 = 0;
                q4 = 0;
                q5 = 0;
                q6 = 0;
                q7 = 0;
            }

            cid = parseInt(cid);

            $.ajax({
                url:"/studentManageSystem/updateChooseCourse",
                type:"post",
                data:{chooseid:chooseid,cid:cid,sid:sid,state:state,normalscore:normalscore,testscore:testscore,finalscore:finalscore,q1:q1,q2:q2,q3:q3,q4:q4,q5:q5,q6:q6,q7:q7},
                success:function(data){
                    if(data=="OK"){
                        alert("修改成功");
                        $table.bootstrapTable('refresh');
                        $("#updateModal").modal("hide");
                    }else{
                        alert("修改失败");
                    }
                }
            })
        });


        function init(){
            $("#cid").empty();
            $.ajax({
                url:"/util/getCourseInfos",
                type:"post",
                success:function(data){
                    for(var i = 0;i<data.length;i++){
                        $("#cid").append("<option value="+data[i]['courseid']+">"+data[i]['coursename']+"</option>")
                    }
                    $.ajax({
                        url:"/studentManageSystem/getTeacherInfoByCourseId/"+data[0]['courseid'],
                        type:"post",
                        success:function(data){
                            $("#teachername").val(data);
                        }
                    });

                    $.ajax({
                        url:"/studentManageSystem/initQxAndLabel/"+data[0]['courseid'],
                        type:"post",
                        success:function(res){
                            var indexs = res[0].split(" ");
                            var score = res[1].split(" ");
                            var label = ['工程知识及分析','工程知识及分析','终身学习','使用现代工具','项目管理','设计/开发解决方案','研究'];
                            $(".lq").hide();
                            $(".qx").hide();
                            for(var i = 0;i<label.length;i++){
                                $(".qx").eq(i).val(0);
                            }
                            for(var i = 0;i<indexs.length;i++){
                                $(".lq").eq(parseInt(indexs[i])).text(label[i]+"(0-"+score[i]+")");
                                $(".lq").eq(parseInt(indexs[i])).show();
                                $(".qx").eq(parseInt(indexs[i])).show();
                            }
                        }
                    });

                    $.ajax({
                        url:"/studentManageSystem/getCourseStateByCid/"+data[0]['courseid'],
                        type:"post",
                        success:function(data){
                            $("#state").val(data);
                        }
                    });
                }
            });

            $("#updateCid").empty();
            $.ajax({
                url:"/util/getCourseInfos",
                type:"post",
                success:function(data){
                    for(var i = 0;i<data.length;i++){
                        $("#updateCid").append("<option value="+data[i]['courseid']+">"+data[i]['coursename']+"</option>")
                    }

                    $.ajax({
                        url:"/studentManageSystem/getTeacherInfoByCourseId/"+data[0]['courseid'],
                        type:"post",
                        success:function(data){
                            $("#updateTeacherName").val(data);
                        }
                    });

                    $.ajax({
                        url:"/studentManageSystem/getCourseStateByCid/"+data[0]['courseid'],
                        type:"post",
                        success:function(data){
                            $("#updateState").val(data);
                        }
                    });
                }
            });

        }

        // bootstrap table初始化
        $table.bootstrapTable({
            url: '/studentManageSystem/getSelectTeacherCourseInfo',
            height: getHeight(),
            striped: true,
            search: true,
            showRefresh: true,
            showColumns: true,
            minimumCountColumns: 2,
            clickToSelect: true,
            detailView: true,
            pagination: true,
            paginationLoop: false,
            sidePagination: 'server',
            silentSort: false,
            sortOrder: "desc",
            smartDisplay: false,
            escape: true,
            searchOnEnterKey: true,
            idField: 'id',
            maintainSelected: true,
            toolbar: '#toolbar',
            columns: [
                {field: 'ck', checkbox: true},
                {field: 'chooseid', title: '所选课程编号', align: 'center'},
                {field: 'cid', title: '课程编号',align: 'center'},
                {field: 'coursename', title: '课程名称',align: 'center'},
                {field: 'sid', title: '学生编号',align: 'center'},
                {field: 'studentname', title: '学生名称',align: 'center'},
                {field: 'tid', title: '教师编号',align: 'center'},
                {field: 'teachername', title: '教师名称',align: 'center'},
                {field: 'normalscore', title: '平时成绩',align: 'center'},
                {field: 'testscore', title: '考试成绩',align: 'center'},
                {field: 'finalscore', title: '期末成绩',align: 'center'},
                {field:'q1',title:'工程知识及分析',align:'center'},
                {field:'q2',title:'团队合作与沟通',align:'center'},
                {field:'q3',title:'终身学习',align:'center'},
                {field:'q4',title:'使用现代工具',align:'center'},
                {field:'q5',title:'项目管理',align:'center'},
                {field:'q6',title:'设计/开发解决方案',align:'center'},
                {field:'q7',title:'研究',align:'center'},
                {field: 'state', title: '状态',align: 'center'},
                {field: 'action', title: '操作', align: 'center', formatter: 'actionFormatter', events: 'actionEvents', clickToSelect: false}
            ]
        });
    });

    // 格式化操作按钮
    function actionFormatter(value, row, index) {
        return [
            '<a class="update" href="javascript:;" onclick="updateAction()" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>　',
            '<a class="delete" href="javascript:;" onclick="deleteAction()" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-remove"></i></a>'
        ].join('');
    }
    // 格式化时间
    function timeFormatter(value , row, index) {
        return new Date(value).toLocaleString().split(' ')[0];
    }

    function getHeight() {
        return $(window).height() - 20;
    }

    // 删除
    var deleteDialog;
    function deleteAction() {
        var rows = $table.bootstrapTable('getSelections');
        if (rows.length == 0) {
            $.confirm({
                title: false,
                content: '请至少选择一条记录！',
                autoClose: 'cancel|3000',
                backgroundDismiss: true,
                buttons: {
                    cancel: {
                        text: '取消',
                        btnClass: 'waves-effect waves-button'
                    }
                }
            });
        } else {
            deleteDialog = $.confirm({
                type: 'red',
                animationSpeed: 300,
                title: false,
                content: '确认删除该选课信息吗？',
                buttons: {
                    confirm: {
                        text: '确认',
                        btnClass: 'waves-effect waves-button',
                        action: function () {
                            var ids = new Array();
                            for (var i in rows) {
                                ids.push(rows[i].chooseid);
                            }
                            $.ajax({
                                type: 'get',
                                url: '/studentManageSystem/deleteChooseCourseByIds/'+ids.join("-"),
                                success: function(result) {
                                    if(result == "OK"){
                                        deleteDialog.close();
                                        $table.bootstrapTable('refresh');
                                        alert("删除成功");
                                    }else{
                                        alert("删除失败");
                                    }
                                },
                                error: function(XMLHttpRequest, textStatus, errorThrown) {
                                    $.confirm({
                                        theme: 'dark',
                                        animation: 'rotateX',
                                        closeAnimation: 'rotateX',
                                        title: false,
                                        content: textStatus,
                                        buttons: {
                                            confirm: {
                                                text: '确认',
                                                btnClass: 'waves-effect waves-button waves-light'
                                            }
                                        }
                                    });
                                }
                            });
                        }
                    },
                    cancel: {
                        text: '取消',
                        btnClass: 'waves-effect waves-button'
                    }
                }
            });
        }
    }

    //创建学生信息
    function createAction(){
        $("#createModal").modal("show");
    }

    function uploadAction() {
        $("#uploadModal").modal("show");
    }


    //编辑选课信息
    function updateAction() {
        var rows = $table.bootstrapTable('getSelections');
        if (rows.length == 0) {
            $.confirm({
                title: false,
                content: '请至少选择一条记录！',
                autoClose: 'cancel|3000',
                backgroundDismiss: true,
                buttons: {
                    cancel: {
                        text: '取消',
                        btnClass: 'waves-effect waves-button'
                    }
                }
            });
        } else {
            //赋初值
            var obj = rows[0];

            var chooseid = obj["chooseid"];
            var cid = obj["cid"];
            var coursename = obj["coursename"];
            var sid = obj["sid"];
            var studentname = obj["studentname"];
            var tid = obj["tid"];
            var teachername = obj["teachername"];
            var normalscore = obj["normalscore"];
            var testscore = obj["testscore"];
            var finalscore = obj["finalscore"];
            var state = obj["state"];

            $("#updateChooseId").val(chooseid);
            $("#updateCid option[value='"+cid+"']").attr("selected","selected");
            $("#updateSid").val(sid);
            $("#updateState").val(state);
            $("#updateNormalscore").val(normalscore);
            $("#updateTestScore").val(testscore);
            $("#updateFinalScore").val(finalscore);
            $("#uq1").val(obj['q1']);
            $("#uq2").val(obj['q2']);
            $("#uq3").val(obj['q3']);
            $("#uq4").val(obj['q4']);
            $("#uq5").val(obj['q5']);
            $("#uq6").val(obj['q6']);
            $("#uq7").val(obj['q7']);

            $.ajax({
                url:"/studentManageSystem/getTeacherInfoByCourseId/"+cid,
                type:"post",
                success:function(data){
                    $("#updateTeacherName").val(data);
                }
            });

            $.ajax({
                url:"/studentManageSystem/initQxAndLabel/"+cid,
                type:"post",
                success:function(res){
                    var indexs = res[0].split(" ");
                    var score = res[1].split(" ");
                    var label = ['工程知识及分析','终身学习','使用现代工具','项目管理','设计/开发解决方案','研究',''];
                    $(".ulq").hide();
                    $(".uqx").hide();
                    for(var i = 0;i<indexs.length;i++){
                        $(".ulq").eq(parseInt(indexs[i])).text(label[i]+"(0-"+score[i]+")");
                        $(".ulq").eq(parseInt(indexs[i])).show();
                        $(".uqx").eq(parseInt(indexs[i])).show();
                    }
                }
            });

            $("#updateModal").modal('show');
        }
    }

</script>

<!-- 添加专业信息模态框（Modal） -->
<div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="createModalTitle">
                    添加选课信息
                </h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="cid">课程名称</label>
                        <select class="form-control" id="cid" name="cid" placeholder="courseId"></select>
                    </div>

                    <div class="form-group">
                        <label for="teachername">教师</label>
                        <input type="text" class="form-control" id="teachername" name="teachername" placeholder="TeacherName" readonly="readonly"></input>
                    </div>

                    <div class="form-group">
                        <label for="sid">学生学号</label>
                        <input class="form-control" id="sid" name="sid" placeholder="StudentId"></input>
                    </div>

                    <div class="form-group">
                        <label for="sname">学生姓名</label>
                        <input class="form-control" id="sname" name="sname" placeholder="StudentName"></input>
                    </div>

                    <div class="form-group">
                        <label for="state">状态</label>
                        <input class="form-control" id="state" name="state" placeholder="State" readonly="readonly"/>
                    </div>

                    <div class="form-group">
                        <label for="normalscore">平时成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="normalscore" name="normalscore" placeholder="NormalScore"></input>
                    </div>

                    <div class="form-group">
                        <label for="testscore">考试成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="testscore" name="testscore" placeholder="TestScore"></input>
                    </div>


                    <div class="form-group">
                        <label for="finalscore">期末成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="finalscore" name="finalscore" placeholder="FinalScore"></input>
                    </div>

                    <div class="form-group">
                        <label for="q1" class="lq">工程知识及分析</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q1" name="q1" placeholder="q1"></input>
                    </div>

                    <div class="form-group">
                        <label for="q2" class="lq">团队合作与沟通</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q2" name="q2" placeholder="q2"></input>
                    </div>


                    <div class="form-group">
                        <label for="q3" class="lq">终身学习</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q3" name="q3" placeholder="q3"></input>
                    </div>


                    <div class="form-group">
                        <label for="q4" class="lq">使用现代工具</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q4" name="q4" placeholder="q4"></input>
                    </div>

                    <div class="form-group">
                        <label for="q5" class="lq">项目管理</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q5" name="q5" placeholder="q5"></input>
                    </div>

                    <div class="form-group">
                        <label for="q6" class="lq">设计/开发解决方案</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q6" name="q6" placeholder="q6"></input>
                    </div>

                    <div class="form-group">
                        <label for="q7" class="ulq">研究</label>
                        <input type="number" min="0" max="100" class="form-control qx" id="q7" name="q7" placeholder="q7"></input>
                    </div>


                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" id="submitbutton">
                    添加
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 修改选课信息模态框（Modal） -->
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="updateModalTitle">
                    打分
                </h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="updateChooseId">所选课程编号</label>
                        <input type="text" class="form-control" id="updateChooseId" name="updateChooseId" placeholder="ChooseId" readonly="readonly"/>
                    </div>

                    <div class="form-group">
                        <label for="updateCid">课程名称</label>
                        <select class="form-control" id="updateCid" name="updateCid" placeholder="courseId" readonly="readonly"></select>
                    </div>

                    <div class="form-group">
                        <label for="updateTeacherName">教师</label>
                        <input type="text" class="form-control" id="updateTeacherName" name="updateTeacherName" placeholder="TeacherName" readonly="readonly"></input>
                    </div>

                    <div class="form-group">
                        <label for="updateSid">学生学号</label>
                        <input class="form-control" id="updateSid" name="updateSid" placeholder="StudentId" readonly="readonly"></input>
                    </div>

                    <div class="form-group">
                        <label for="updateState">状态</label>
                        <input class="form-control" id="updateState" name="updateState" placeholder="State" readonly="readonly"></input>
                    </div>

                    <div class="form-group">
                        <label for="updateNormalscore">平时成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="updateNormalscore" name="updateNormalscore" placeholder="NormalScore"></input>
                    </div>

                    <div class="form-group">
                        <label for="updateTestScore">考试成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="updateTestScore" name="updateTestScore" placeholder="TestScore"></input>
                    </div>


                    <div class="form-group">
                        <label for="updateFinalScore">期末成绩</label>
                        <input type="number" min="0" max="100" class="form-control" id="updateFinalScore" name="updateFinalScore" placeholder="FinalScore"></input>
                    </div>

                    <div class="form-group">
                        <label for="q1" >工程知识及分析</label>
                        <input type="number" min="0" max="100" class="form-control" id="uq1" name="q1" placeholder="q1"></input>
                    </div>

                    <div class="form-group">
                        <label for="q2" >团队合作与沟通</label>
                        <input type="number" min="0" max="100" class="form-control " id="uq2" name="q2" placeholder="q2"></input>
                    </div>


                    <div class="form-group">
                        <label for="q3" >终身学习</label>
                        <input type="number" min="0" max="100" class="form-control " id="uq3" name="q3" placeholder="q3"></input>
                    </div>


                    <div class="form-group">
                        <label for="q4" >使用现代工具</label>
                        <input type="number" min="0" max="100" class="form-control" id="uq4" name="q4" placeholder="q4"></input>
                    </div>

                    <div class="form-group">
                        <label for="q5">项目管理</label>
                        <input type="number" min="0" max="100" class="form-control " id="uq5" name="q5" placeholder="q5"></input>
                    </div>

                    <div class="form-group">
                        <label for="q6" >设计/开发解决方案</label>
                        <input type="number" min="0" max="100" class="form-control " id="uq6" name="q6" placeholder="q6"></input>
                    </div>

                    <div class="form-group">
                        <label for="q7" >研究</label>
                        <input type="number" min="0" max="100" class="form-control " id="uq7" name="q7" placeholder="q7"></input>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" id="updateSubmitButton">
                    确认修改
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 导入教师信息模态框（Modal） -->
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="uploadModalTitle">
                    导入选课信息
                </h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="file">上传文件</label>
                        <input type="file" class="form-control" id="file" name="file" type="tel"/>
                    </div>
                </form>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" id="uploadbutton">
                    添加
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

</body>
</html>